<template>
  <view>
    <view class="colorB" style="padding:30rpx;" v-for="(item ,index) in stationBillingTemplate" :index="index"
      :key="index">
      <view class="mainColor border-10" style="border: 1px solid #fff;">
        <view class="flex justify-between align-center padding-10">
          模板编号：{{item.templateCode}}
        </view>
        <view class=" padding-10">名称：{{item.templateName}}</view>
        <view class=" padding-10">描述：{{item.remark}}</view>
        <view class=" padding-10">设备类型：{{deviceType(item.deviceType) }}</view>
        <view class="padding-10">上次发布时间（kw）：{{item.publishTime}}</view>
        <!--  <view class="padding-10">
          <text>操作：</text>
          <text style="color: aqua;">发布</text>
          <text style="margin: 0 20rpx;color: aqua;">修改默认费率</text>
          <text style="color: aqua;">删除</text>
        </view> -->
      </view>
    </view>
  </view>
</template>

<script>
  import {
    checkPermi,
    checkRole
  } from "@/utils/permission";
  import {
    queryStationBillingTemplateList,
  } from "@/api/billing/template.js";
  import {
    deviceType
  } from '@/common/dict.js'
  export default {
    props: ['stationId'],
    data() {
      return {
        deviceTypeList: [],
        connectorTypeList: [],
        payStatusList: [],
        // 总条数
        total: 0,
        // 订单表格数据
        stationBillingTemplate: [],
      };
    },
    methods: {
      checkPermi,
      checkRole,
      connectorType(sim) {
        connectorType.then(result => {
          this.connectorTypeList = result
        })
        let str = this.connectorTypeList.find(item => item.dictValue == sim)
        if (str == undefined) {
          return '一'
        } else {
          return str.dictLabel
        }
      },
      payStatus(sim) {
        payStatus.then(result => {
          this.payStatusList = result
        })
        let str = this.payStatusList.find(item => item.dictValue == sim)
        if (str == undefined) {
          return '一'
        } else {
          return str.dictLabel
        }
      },
      deviceType(sim) {
        deviceType.then(result => {
          this.deviceTypeList = result
        })
        let str = this.deviceTypeList.find(item => item.dictValue == sim)
        if (str == undefined) {
          return '一'
        } else {
          return str.dictLabel
        }
      },
      getStationBillingTemplateList() {
        console.log(this.stationId, 'this.stationId');
        queryStationBillingTemplateList(this.stationId).then(response => {
          this.stationBillingTemplate = response.rows;
          console.log('this.stationBillingTemplate', this.stationBillingTemplate)
        });
      },
    },
    created() {
      this.getStationBillingTemplateList()
    }
  }
</script>

<style lang="scss">

</style>